package com.jerry.consumer.client;

import com.jerry.common.bean.Product;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "provider-product",fallbackFactory = ProductFallbackFactory.class)
@RequestMapping("/product")
public interface ProductClient {

    //查询用户列表
    @GetMapping("/list")
    public List<Product> list();

    //根据id查询用户
    @GetMapping("/get/{id}")
    public Product get(@PathVariable("id") Long id);

    //增加用户
    @PostMapping("/add")
    public boolean add(@RequestBody Product product);

    //更新用户
    @PostMapping("/update")
    public boolean update(@RequestBody Product product);

    //删除用户
    @DeleteMapping("/delete/{id}")
    public void delete(@PathVariable("id") Long id);

}
